import {RouterModule, Routes} from "@angular/router";
import {NgModule} from "@angular/core";
import {CamManageHomeComponent} from "./cam-manage/cam-manage-home/cam-manage-home.component";
import {CamManageAddComponent} from "./cam-manage/cam-manage-form/cam-manage-add/cam-manage-add.component";
import {CamManageEditComponent} from "./cam-manage/cam-manage-form/cam-manage-edit/cam-manage-edit.component";
import {CamSearchHomeComponent} from "./cam-search/cam-search-home/cam-search-home.component";
import {CamApplyByUserComponent} from "./cam-apply/cam-apply-by-user/cam-apply-by-user.component";
import {CamApplyByManagerComponent} from "./cam-apply/cam-apply-by-manager/cam-apply-by-manager.component";
import {TypeHomeComponent} from "./cam-type/type-home/type-home.component";
import {TypeFormComponent} from "./cam-type/type-form/type-form.component";
import {TypeAddFormComponent} from "./cam-type/type-add-form/type-add-form.component";
import {TypeEditFormComponent} from "./cam-type/type-edit-form/type-edit-form.component";
import {BatchAssignComponent} from "./batch-assign/batch-assign.component";
import {MaintenanceHomeComponent} from "./maintenance/maintenance-home/maintenance-home.component";
import {MaintenanceFormComponent} from "./maintenance/maintenance-form/maintenance-form.component";
import {MaintenanceAddFormComponent} from "./maintenance/maintenance-add-form/maintenance-add-form.component";
import {MaintenanceEditFormComponent} from "./maintenance/maintenance-edit-form/maintenance-edit-form.component";
import {DriverHomeComponent} from "./driver/driver-home/driver-home.component";
import {DriverAddFormComponent} from "./driver/driver-add-form/driver-add-form.component";
import {DriverEditFormComponent} from "./driver/driver-edit-form/driver-edit-form.component";
import {CamCalendarComponent} from "./cam-apply/cam-apply-home/cam-calendar/cam-calendar.component";
import {CamDetailHomeComponent} from "./cam-detail/cam-detail-home/cam-detail-home.component";
import {MaintainRecordComponent} from "./cam-detail/maintain-record/maintain-record.component";
import {CamRemandComponent} from "./cam-remand/cam-remand.component";
import {NewCamTypeComponent} from "./new-maintain/new-cam-type/new-cam-type.component";
import {NewDriverComponent} from "./new-maintain/new-driver/new-driver.component";
import {NewMaintenanceTypeComponent} from "./new-maintain/new-maintenance-type/new-maintenance-type.component";
import {NewCamManageComponent} from "./new-cam-manage/new-cam-manage.component";

const routers:Routes =[
  {
    path:'',
    redirectTo:"camManage",
    pathMatch:"full"
  },
  // {
  //   path:'camManage',
  //   component:CamManageHomeComponent,
  //   children:[
  //     {path: '', redirectTo: "new", pathMatch: "full"},
  //     {path: 'new', component: CamManageAddComponent},
  //     {path: 'edit/:oid', component: CamManageEditComponent}
  //   ]
  // },
  {
    path:'camSearch',
    component:CamSearchHomeComponent,
    children:[
      {path: '', redirectTo: "camSearch", pathMatch: "full"},
      {path: 'camSearch', component: CamSearchHomeComponent},
      {path: 'camSearch/:userId', component: CamSearchHomeComponent}
    ]
  },
  {
    path: 'camApplyByUser',
    component: CamApplyByUserComponent
  },
  {
    path:'camApplyByManager',
    component:CamApplyByManagerComponent
  },
  // {
  //   path: 'camType',
  //   component: TypeHomeComponent,
  //   children: [
  //     {path: '',
  //       component: TypeFormComponent,
  //       children: [
  //         {path: '', redirectTo: 'new', pathMatch: 'full'},
  //         {path: 'new', component: TypeAddFormComponent},
  //         {path: 'edit/:oidByType', component: TypeEditFormComponent }
  //       ]
  //
  //     }
  //   ]
  // },
  {
    path:'batchAssign',
    component:BatchAssignComponent
  },
  // {
  //   path: 'maintenance',
  //   component: MaintenanceHomeComponent,
  //   children: [
  //     {path: '',
  //       component: MaintenanceFormComponent,
  //       children: [
  //         {path: '', redirectTo: 'new', pathMatch: 'full'},
  //         {path: 'new', component: MaintenanceAddFormComponent},
  //         {path: 'edit/:oidByType', component: MaintenanceEditFormComponent }
  //       ]
  //
  //     }
  //   ]
  // },
  // {
  //   path:'driver',
  //   component:DriverHomeComponent,
  //   children:[
  //     {path: '', redirectTo: "new", pathMatch: "full"},
  //     {path: 'new', component: DriverAddFormComponent},
  //     {path: 'edit/:oid', component: DriverEditFormComponent}
  //   ]
  // },
  {
    path:'camCalendar',
    component:CamCalendarComponent,
    children:[
      {path: '',
        component: CamCalendarComponent,
        children: [
          {path: '', redirectTo: "camCalendar", pathMatch: "full"},
          {path: 'camCalendar', component: CamCalendarComponent},
          {path: 'camCalendar/:vehicleoid', component: CamCalendarComponent}
        ]}
    ]
  },
  {
    path:'camDetail',
    component:CamDetailHomeComponent
  },
  {
    path:'camMaintainRecordDetail',
    component:MaintainRecordComponent
  },
  {
    path:'camRemand',
    component:CamRemandComponent
  },
  {
    path:'camType',
    component:NewCamTypeComponent
  },
  {
    path:'driver',
    component:NewDriverComponent
  },
  {
    path:'maintenance',
    component:NewMaintenanceTypeComponent
  },
  {
    path:'camManage',
    component:NewCamManageComponent
  }

];

@NgModule({
  imports: [RouterModule.forRoot(routers)],
  exports: [RouterModule],
  providers: []
})
export class AppRoutingModule { }
